package bean;

public class TransactedItem {

	int userId;
	int itemId;
	int itemQuantity;
	float itemPrice;
	int transactionId;
	char transactionType;
	
	public void setUserId(int userId) {
		this.userId = userId;
	}
	
	public void setItemId(int ItemId) {
		this.itemId = ItemId;
	}
	
	public void setItemQuantity(int itemQuantity) {
		this.itemQuantity = itemQuantity;
	}
	
	public void setItemPrice(float itemPrice) {
		this.itemPrice = itemPrice;
	}
	
	public int getUserId() {
		return this.userId;
	}
	
	public int getItemId() {
		return this.itemId;
	}
	
	public int getItemQuantity() {
		return this.itemQuantity;
	}
	
	public float getItemPrice() {
		return this.itemPrice;
	}
	
	public String toString() {
		
		String result = new String();		
					
		result = userId+":#" + itemId+":#" + itemQuantity+":#" + itemPrice+":#" + transactionId +":#" + transactionType;
		return result;
		
		
	}
	
	public static String convertArrayToString(TransactedItem[] aTI) {
		
		String result = null;
		
		
		for(int i=0;i<aTI.length;i++) {
			if(i==0) {
				result = aTI[i].toString();
			}
			else {
				result += "[]" + aTI[i].toString();
			}
		}
		
		return result;
	}
	
}
